Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The disposal method "restore to previous" should restore to what was there before the graphic is drawn, so to the image data after the disposal of the previous frame, not to the previous frame. This disposal method isn't used very often, but I've encountered a few GIFs where it is an issue. A few examples are on this page.
The GIF Spec says:
Which I didn't quite know how to interpret exactly (and there do seem to be different interpretations on some websites that explain how it's supposed to work), but based on the GIFs I encountered and how modern browsers handle them, this fix should be correct.
Example
Following are screenshots of the individual frames of this GIF (top row the finished frame, bottom row what each frame adds). In this case, the GIF uses "restore to previous" to fully clear each frame (which works because each frame uses it, so it always restores to the empty canvas present before drawing the first frame's graphic).
Original:
Fixed:
This change is my own work and while I'm not convinced I can legally disclaim or transfer copyright, you can see this change as being under CC0, so effectively Public Domain.